Socket
Socket
Sign inDemoInstall

@nextgis/control-container

Package Overview
Dependencies
11
Maintainers
3
Versions
108
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @nextgis/control-container

Placing control elements in the corners of the map container


Version published
Weekly downloads
16
increased by60%
Maintainers
3
Created
Weekly downloads
 

Changelog

Source

1.19.2 (2023-12-13)

Bug Fixes

  • geocoder: set nominatim geocoder options (2ae48c4)

Readme

Source

Control Container

size version

This library allows placing control elements in the corners of the map container.

Libraries such as Leaflet and Mapbox GL JS are already doing this, but Cesium and Openlayers do not have similar functionality.

╭───────────────────────────────────────────╮
│ top-left                        top-right │
│                   MAP                     │
│ bottom-left                  bottom-right │
╰───────────────────────────────────────────╯

Installation

# latest stable
$ npm install --save-dev @nextgis/control-container
# or
$ yarn add @nextgis/control-container

Usage

import ControlContainer from '@nextgis/control-container';

// initialization
const controlContainer = new ControlContainer({ target: 'map-control-id' });
// or
const controlContainer = new ControlContainer({ map: webMap });
controlContainer.addTo('.map-control-class');

// add simple HTML string
controlContainer.append('<div>HTML</div>', 'top-right');
// or HTML element
controlContainer.append(HTMLElement, 'top-right');

// add control
const control = {
    onAdd(webMap) {
        const container = document.createContainer('div');
        webMap.emitter.on('zoomend', () => {
            container.innerHTML = webMap.getZoom();
        });
        return container
    }
}
controlContainer.addControl(control, 'bottom-right');

Commercial support

Need to fix a bug or add a feature to @nextgis/control-container? We provide custom development and support for this software. Contact us to discuss options!

http://nextgis.com

Keywords

FAQs

Last updated on 13 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc